#!usr/bin/env python
# -*- coding: utf-8 -*-
import frida, sys

def on_message(message, data):
    print(message)
    print(data)
    #print("[on_message] message:", message, "data:", data)
processes = frida.get_remote_device().enumerate_processes()
for process in processes:
    print(process)
session = frida.get_remote_device().attach(9833)


jscode = """  
Java.perform(function() {
    var clazz = Java.use('com.ss.android.ugc.aweme.comment.e.f');
    clazz.setRequestId.implementation = function() {

        send(arguments[0]); 

        return clazz.setRequestId.apply(this, arguments);
    }
}); 
"""

script = session.create_script(jscode)

script.on("message", on_message)
script.load()
sys.stdin.read()
